if (typeof window.event != 'undefined') { 
	document.onkeydown = function() {
		var type = event.srcElement.type;
		var code = event.keyCode;
		if ((code != 8 && code != 13) || 
			(type == 'text' && code != 13 && !(code=8 && event.srcElement.readOnly)) || 
			(type == 'password' && code != 13 && !(code=8 && event.srcElement.readOnly)) || 
			(type == 'textarea') || 
			(type == 'submit' && code == 13 && !(code=8 && event.srcElement.readOnly))) { 
			return true;   
		} else {   
          return false ;   
		}
	}   
} else { // FireFox/Others
	document.onkeypress = function(e) {
		var type = e.target.localName.toLowerCase();
		var code = e.keyCode;
		if ((code != 8 && code != 13) || (type == 'input' && code != 13 && !(code=8 && event.srcElement.readOnly)) || (type == 'textarea') || (type == 'submit' && code == 13 && !(code=8 && event.srcElement.readOnly))) { 
			return true;   
		} else {   
          return false ;   
		}   
    }   
} 